<template>
	<view class="content">
		<view class="list">
			<view class="list-item" v-for="(item, index) in list" @click="go()">
				<view class="tit">
					<text class="da">{{item.title}}</text>
					<text>{{item.num}} </text><span class="dace">吨</span>
				</view>

				<view class="desc descd">
					<text>规格：{{item.sku}}</text>
					<text class="address">收货地：{{item.address}}</text>
				</view>
				<view class="desc">{{item.remark}}</view>

				<view class="time">
					<div>{{item.procurement_ycle == 0?'单次':item.procurement_ycle == 1?'每月':'不限'}}采购 <span
							style="margin:0 10rpx">/</span> {{gettime(item.createtime *1000)}}</div>
					<zb-tooltip color="white" content="Bottom" placement="left-end" ref="tooltip6">
						<u-icon name="more-dot-fill"></u-icon>
						<view slot="content">
							<view class="tip">
								<view @click="edit(item.id)">编辑</view>
								<!-- <view>下架</view> -->
								<view style="border: none;margin-bottom: 0;">删除</view>
							</view>
						</view>
					</zb-tooltip>
				</view>
			</view>
		</view>
	</view>
</template>
<script>
	export default {
		name: "index",
		components: {},
		props: {
			list: {
				type: Array,
				default: []
			}
		},
		data() {
			return {
				isShow: false,

			};
		},
		methods: {
			edit(id) {
				this.$.open('/pages/release/form?type=2&id=' + id)
			},
			go() {
				// uni.navigateTo({url: '/pages/buy/buyDetails'})
			},
			gettime(e) {
				let date = new Date(e);
				let year = date.getFullYear();
				let month = date.getMonth() + 1; // 注意：月份是从0开始的，所以要加1  
				let day = date.getDate();
				// 如果月或日是个位数，前面补0  
				month = month < 10 ? '0' + month : month;
				day = day < 10 ? '0' + day : day;
				// 组合成年月日的字符串  
				return `${year}-${month}-${day}`;
			}
		},
		created() {},
		mounted() {},
	};
</script>

<style lang="scss" scoped>
	.content {
		// margin: 0 20rpx;

		.list {
			.list-item {
				margin-bottom: 20rpx;
				border-right: 12rpx;
				padding: 30rpx;
				background-color: #fff;
				display: flex;
				flex-direction: column;
				// gap: 20rpx;
				color: #666666;
				font-size: 28rpx;
				border-bottom: 1rpx solid #f4f4f4;
				line-height: 40rpx;

				.tit {
					font-size: 32rpx;
					display: flex;
					align-items: baseline;
					color: #131313;
					// gap: 20rpx;
					font-weight: 700;

					.da {
						margin-right: 14rpx;
					}

					.dace {
						// font-weight: 700;
						font-size: 26rpx;
					}
				}

				.time {
					color: #999999;
					flex: 1;
					font-size: 20rpx;
					font-weight: 400;
					display: flex;
					align-items: center;
					justify-content: space-between;
					margin-top: 20rpx;

					.tip {
						display: flex;
						flex-direction: column;
						align-items: center;
						color: #393b3a;
						width: 94rpx;
						justify-content: space-between;
						font-size: 24rpx;
						font-weight: 500;

						view {
							padding-bottom: 10rpx;
							margin-bottom: 10rpx;
							border-bottom: 1rpx solid #ececec;
						}
					}
				}

				.descd {
					margin-top: 10rpx;
				}

				.desc {
					font-size: 28rpx;
					color: #666666;
					font-weight: 400;
					line-height: 40rpx;
					text-align: left;

					// margin-top: 10rpx;
					.address {
						display: inline-block;
						border-left: 1rpx solid #aaaaaa;
						margin-left: 10rpx;
						padding-left: 10rpx;
					}
				}

				.price {
					display: flex;
					align-items: end;
					gap: 20rpx;

					.num {
						color: #686868;
						font-size: 20rpx;
						font-weight: 400;
						margin-bottom: 4rpx;
					}

					.money {
						font-weight: 700;

						text {
							font-size: 40rpx;
							font-weight: 500;
						}
					}
				}

				img {
					width: 100px;
					height: 100px;
				}
			}
		}
	}
</style>